3.195 \(\int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \, dx\)

Optimal. Leaf size=176 \[ \frac {a^2 \left (12 c^2+16 c d+7 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}-\frac {a^2 \left (c^3-8 c^2 d-20 c d^2-8 d^3\right ) \tan (e+f x)}{6 d f}-\frac {a^2 \left (2 c (c-8 d)-21 d^2\right ) \tan (e+f x) \sec (e+f x)}{24 f}+\frac {a^2 \tan (e+f x) (c+d \sec (e+f x))^3}{4 d f}-\frac {a^2 (c-8 d) \tan (e+f x) (c+d \sec (e+f x))^2}{12 d f} \]

[Out]

1/8*a^2*(12*c^2+16*c*d+7*d^2)*arctanh(sin(f*x+e))/f-1/6*a^2*(c^3-8*c^2*d-20*c*d^2-8*d^3)*tan(f*x+e)/d/f-1/24*a
^2*(2*c*(c-8*d)-21*d^2)*sec(f*x+e)*tan(f*x+e)/f-1/12*a^2*(c-8*d)*(c+d*sec(f*x+e))^2*tan(f*x+e)/d/f+1/4*a^2*(c+
d*sec(f*x+e))^3*tan(f*x+e)/d/f

________________________________________________________________________________________

Rubi [A]  time = 0.26, antiderivative size = 234, normalized size of antiderivative = 1.33, number of steps used = 8, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {3987, 90, 80, 50, 63, 217, 203} \[ \frac {a^2 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)}{8 f}+\frac {a^3 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x) \tan ^{-1}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a (\sec (e+f x)+1)}}\right )}{4 f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}+\frac {\left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{24 f}+\frac {d (5 c+2 d) \tan (e+f x) (a \sec (e+f x)+a)^2}{12 f}+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2 (c+d \sec (e+f x))}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]*(a + a*Sec[e + f*x])^2*(c + d*Sec[e + f*x])^2,x]

[Out]

(a^2*(12*c^2 + 16*c*d + 7*d^2)*Tan[e + f*x])/(8*f) + (a^3*(12*c^2 + 16*c*d + 7*d^2)*ArcTan[Sqrt[a - a*Sec[e +
f*x]]/Sqrt[a*(1 + Sec[e + f*x])]]*Tan[e + f*x])/(4*f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]) + (d*(
5*c + 2*d)*(a + a*Sec[e + f*x])^2*Tan[e + f*x])/(12*f) + ((12*c^2 + 16*c*d + 7*d^2)*(a^2 + a^2*Sec[e + f*x])*T
an[e + f*x])/(24*f) + (d*(a + a*Sec[e + f*x])^2*(c + d*Sec[e + f*x])*Tan[e + f*x])/(4*f)

Rule 50

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^n)/(b*
(m + n + 1)), x] + Dist[(n*(b*c - a*d))/(b*(m + n + 1)), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 80

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(b*(c + d*x)
^(n + 1)*(e + f*x)^(p + 1))/(d*f*(n + p + 2)), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

Rule 90

Int[((a_.) + (b_.)*(x_))^2*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(b*(a + b*
x)*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/(d*f*(n + p + 3)), x] + Dist[1/(d*f*(n + p + 3)), Int[(c + d*x)^n*(e +
 f*x)^p*Simp[a^2*d*f*(n + p + 3) - b*(b*c*e + a*(d*e*(n + 1) + c*f*(p + 1))) + b*(a*d*f*(n + p + 4) - b*(d*e*(
n + 2) + c*f*(p + 2)))*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 3, 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 3987

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[(a^2*g*Cot[e + f*x])/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x
]]), Subst[Int[((g*x)^(p - 1)*(a + b*x)^(m - 1/2)*(c + d*x)^n)/Sqrt[a - b*x], x], x, Csc[e + f*x]], x] /; Free
Q[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p,
 1] || IntegerQ[m - 1/2])

Rubi steps

\begin {align*} \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \, dx &=-\frac {\left (a^2 \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {(a+a x)^{3/2} (c+d x)^2}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {d (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \tan (e+f x)}{4 f}+\frac {\tan (e+f x) \operatorname {Subst}\left (\int \frac {(a+a x)^{3/2} \left (-a^2 \left (4 c^2+2 c d+d^2\right )-a^2 d (5 c+2 d) x\right )}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{4 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {d (5 c+2 d) (a+a \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {d (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \tan (e+f x)}{4 f}-\frac {\left (a^2 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {(a+a x)^{3/2}}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{12 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {d (5 c+2 d) (a+a \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {\left (12 c^2+16 c d+7 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac {d (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \tan (e+f x)}{4 f}-\frac {\left (a^3 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {\sqrt {a+a x}}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{8 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {a^2 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)}{8 f}+\frac {d (5 c+2 d) (a+a \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {\left (12 c^2+16 c d+7 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac {d (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \tan (e+f x)}{4 f}-\frac {\left (a^4 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{8 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {a^2 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)}{8 f}+\frac {d (5 c+2 d) (a+a \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {\left (12 c^2+16 c d+7 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac {d (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \tan (e+f x)}{4 f}+\frac {\left (a^3 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {2 a-x^2}} \, dx,x,\sqrt {a-a \sec (e+f x)}\right )}{4 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {a^2 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)}{8 f}+\frac {d (5 c+2 d) (a+a \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {\left (12 c^2+16 c d+7 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac {d (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \tan (e+f x)}{4 f}+\frac {\left (a^3 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right )}{4 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {a^2 \left (12 c^2+16 c d+7 d^2\right ) \tan (e+f x)}{8 f}+\frac {a^3 \left (12 c^2+16 c d+7 d^2\right ) \tan ^{-1}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right ) \tan (e+f x)}{4 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}+\frac {d (5 c+2 d) (a+a \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {\left (12 c^2+16 c d+7 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{24 f}+\frac {d (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \tan (e+f x)}{4 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 1.00, size = 479, normalized size = 2.72 \[ -\frac {a^2 \sec ^4(e+f x) \left (12 \left (12 c^2+16 c d+7 d^2\right ) \cos (2 (e+f x)) \left (\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )\right )+3 \left (12 c^2+16 c d+7 d^2\right ) \cos (4 (e+f x)) \left (\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )\right )-24 c^2 \sin (e+f x)-96 c^2 \sin (2 (e+f x))-24 c^2 \sin (3 (e+f x))-48 c^2 \sin (4 (e+f x))+108 c^2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-108 c^2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )-96 c d \sin (e+f x)-224 c d \sin (2 (e+f x))-96 c d \sin (3 (e+f x))-80 c d \sin (4 (e+f x))+144 c d \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-144 c d \log \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )-90 d^2 \sin (e+f x)-128 d^2 \sin (2 (e+f x))-42 d^2 \sin (3 (e+f x))-32 d^2 \sin (4 (e+f x))+63 d^2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-63 d^2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )\right )}{192 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]*(a + a*Sec[e + f*x])^2*(c + d*Sec[e + f*x])^2,x]

[Out]

-1/192*(a^2*Sec[e + f*x]^4*(108*c^2*Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + 144*c*d*Log[Cos[(e + f*x)/2] -
Sin[(e + f*x)/2]] + 63*d^2*Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + 12*(12*c^2 + 16*c*d + 7*d^2)*Cos[2*(e +
f*x)]*(Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] - Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]]) + 3*(12*c^2 + 16*c
*d + 7*d^2)*Cos[4*(e + f*x)]*(Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] - Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/
2]]) - 108*c^2*Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]] - 144*c*d*Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]] - 6
3*d^2*Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]] - 24*c^2*Sin[e + f*x] - 96*c*d*Sin[e + f*x] - 90*d^2*Sin[e + f*
x] - 96*c^2*Sin[2*(e + f*x)] - 224*c*d*Sin[2*(e + f*x)] - 128*d^2*Sin[2*(e + f*x)] - 24*c^2*Sin[3*(e + f*x)] -
 96*c*d*Sin[3*(e + f*x)] - 42*d^2*Sin[3*(e + f*x)] - 48*c^2*Sin[4*(e + f*x)] - 80*c*d*Sin[4*(e + f*x)] - 32*d^
2*Sin[4*(e + f*x)]))/f

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 209, normalized size = 1.19 \[ \frac {3 \, {\left (12 \, a^{2} c^{2} + 16 \, a^{2} c d + 7 \, a^{2} d^{2}\right )} \cos \left (f x + e\right )^{4} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (12 \, a^{2} c^{2} + 16 \, a^{2} c d + 7 \, a^{2} d^{2}\right )} \cos \left (f x + e\right )^{4} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (6 \, a^{2} d^{2} + 16 \, {\left (3 \, a^{2} c^{2} + 5 \, a^{2} c d + 2 \, a^{2} d^{2}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (4 \, a^{2} c^{2} + 16 \, a^{2} c d + 7 \, a^{2} d^{2}\right )} \cos \left (f x + e\right )^{2} + 16 \, {\left (a^{2} c d + a^{2} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{48 \, f \cos \left (f x + e\right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e))^2,x, algorithm="fricas")

[Out]

1/48*(3*(12*a^2*c^2 + 16*a^2*c*d + 7*a^2*d^2)*cos(f*x + e)^4*log(sin(f*x + e) + 1) - 3*(12*a^2*c^2 + 16*a^2*c*
d + 7*a^2*d^2)*cos(f*x + e)^4*log(-sin(f*x + e) + 1) + 2*(6*a^2*d^2 + 16*(3*a^2*c^2 + 5*a^2*c*d + 2*a^2*d^2)*c
os(f*x + e)^3 + 3*(4*a^2*c^2 + 16*a^2*c*d + 7*a^2*d^2)*cos(f*x + e)^2 + 16*(a^2*c*d + a^2*d^2)*cos(f*x + e))*s
in(f*x + e))/(f*cos(f*x + e)^4)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e))^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)2/f*((-7*a^2*d^2-16*a^2*d*c-12*a^2*c^2)/16*ln(abs(tan((f*x+exp
(1))/2)-1))-(-7*a^2*d^2-16*a^2*d*c-12*a^2*c^2)/16*ln(abs(tan((f*x+exp(1))/2)+1))+(-21*tan((f*x+exp(1))/2)^7*a^
2*d^2-48*tan((f*x+exp(1))/2)^7*a^2*d*c-36*tan((f*x+exp(1))/2)^7*a^2*c^2+77*tan((f*x+exp(1))/2)^5*a^2*d^2+176*t
an((f*x+exp(1))/2)^5*a^2*d*c+132*tan((f*x+exp(1))/2)^5*a^2*c^2-83*tan((f*x+exp(1))/2)^3*a^2*d^2-272*tan((f*x+e
xp(1))/2)^3*a^2*d*c-156*tan((f*x+exp(1))/2)^3*a^2*c^2+75*tan((f*x+exp(1))/2)*a^2*d^2+144*tan((f*x+exp(1))/2)*a
^2*d*c+60*tan((f*x+exp(1))/2)*a^2*c^2)*1/24/(tan((f*x+exp(1))/2)^2-1)^4)

________________________________________________________________________________________

maple [A]  time = 1.42, size = 268, normalized size = 1.52 \[ \frac {3 a^{2} c^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2 f}+\frac {10 a^{2} c d \tan \left (f x +e \right )}{3 f}+\frac {7 a^{2} d^{2} \sec \left (f x +e \right ) \tan \left (f x +e \right )}{8 f}+\frac {7 a^{2} d^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8 f}+\frac {2 a^{2} c^{2} \tan \left (f x +e \right )}{f}+\frac {2 a^{2} c d \sec \left (f x +e \right ) \tan \left (f x +e \right )}{f}+\frac {2 a^{2} c d \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {4 a^{2} d^{2} \tan \left (f x +e \right )}{3 f}+\frac {2 a^{2} d^{2} \tan \left (f x +e \right ) \left (\sec ^{2}\left (f x +e \right )\right )}{3 f}+\frac {a^{2} c^{2} \sec \left (f x +e \right ) \tan \left (f x +e \right )}{2 f}+\frac {2 a^{2} c d \tan \left (f x +e \right ) \left (\sec ^{2}\left (f x +e \right )\right )}{3 f}+\frac {a^{2} d^{2} \tan \left (f x +e \right ) \left (\sec ^{3}\left (f x +e \right )\right )}{4 f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e))^2,x)

[Out]

3/2/f*a^2*c^2*ln(sec(f*x+e)+tan(f*x+e))+10/3/f*a^2*c*d*tan(f*x+e)+7/8/f*a^2*d^2*sec(f*x+e)*tan(f*x+e)+7/8/f*a^
2*d^2*ln(sec(f*x+e)+tan(f*x+e))+2*a^2*c^2*tan(f*x+e)/f+2/f*a^2*c*d*sec(f*x+e)*tan(f*x+e)+2/f*a^2*c*d*ln(sec(f*
x+e)+tan(f*x+e))+4/3/f*a^2*d^2*tan(f*x+e)+2/3/f*a^2*d^2*tan(f*x+e)*sec(f*x+e)^2+1/2*a^2*c^2*sec(f*x+e)*tan(f*x
+e)/f+2/3/f*a^2*c*d*tan(f*x+e)*sec(f*x+e)^2+1/4/f*a^2*d^2*tan(f*x+e)*sec(f*x+e)^3

________________________________________________________________________________________

maxima [A]  time = 0.63, size = 324, normalized size = 1.84 \[ \frac {32 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{2} c d + 32 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{2} d^{2} - 3 \, a^{2} d^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 12 \, a^{2} c^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 48 \, a^{2} c d {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 12 \, a^{2} d^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 48 \, a^{2} c^{2} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 96 \, a^{2} c^{2} \tan \left (f x + e\right ) + 96 \, a^{2} c d \tan \left (f x + e\right )}{48 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e))^2,x, algorithm="maxima")

[Out]

1/48*(32*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^2*c*d + 32*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^2*d^2 - 3*a^2*d^2*
(2*(3*sin(f*x + e)^3 - 5*sin(f*x + e))/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1) - 3*log(sin(f*x + e) + 1) + 3*l
og(sin(f*x + e) - 1)) - 12*a^2*c^2*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x
+ e) - 1)) - 48*a^2*c*d*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1))
- 12*a^2*d^2*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) + 48*a^2*c^
2*log(sec(f*x + e) + tan(f*x + e)) + 96*a^2*c^2*tan(f*x + e) + 96*a^2*c*d*tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 5.46, size = 237, normalized size = 1.35 \[ \frac {\left (-3\,a^2\,c^2-4\,a^2\,c\,d-\frac {7\,a^2\,d^2}{4}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7+\left (11\,a^2\,c^2+\frac {44\,a^2\,c\,d}{3}+\frac {77\,a^2\,d^2}{12}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\left (-13\,a^2\,c^2-\frac {68\,a^2\,c\,d}{3}-\frac {83\,a^2\,d^2}{12}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (5\,a^2\,c^2+12\,a^2\,c\,d+\frac {25\,a^2\,d^2}{4}\right )\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}+\frac {a^2\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (12\,c^2+16\,c\,d+7\,d^2\right )}{2\,\left (6\,c^2+8\,c\,d+\frac {7\,d^2}{2}\right )}\right )\,\left (12\,c^2+16\,c\,d+7\,d^2\right )}{4\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + a/cos(e + f*x))^2*(c + d/cos(e + f*x))^2)/cos(e + f*x),x)

[Out]

(tan(e/2 + (f*x)/2)*(5*a^2*c^2 + (25*a^2*d^2)/4 + 12*a^2*c*d) - tan(e/2 + (f*x)/2)^7*(3*a^2*c^2 + (7*a^2*d^2)/
4 + 4*a^2*c*d) + tan(e/2 + (f*x)/2)^5*(11*a^2*c^2 + (77*a^2*d^2)/12 + (44*a^2*c*d)/3) - tan(e/2 + (f*x)/2)^3*(
13*a^2*c^2 + (83*a^2*d^2)/12 + (68*a^2*c*d)/3))/(f*(6*tan(e/2 + (f*x)/2)^4 - 4*tan(e/2 + (f*x)/2)^2 - 4*tan(e/
2 + (f*x)/2)^6 + tan(e/2 + (f*x)/2)^8 + 1)) + (a^2*atanh((tan(e/2 + (f*x)/2)*(16*c*d + 12*c^2 + 7*d^2))/(2*(8*
c*d + 6*c^2 + (7*d^2)/2)))*(16*c*d + 12*c^2 + 7*d^2))/(4*f)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a^{2} \left (\int c^{2} \sec {\left (e + f x \right )}\, dx + \int 2 c^{2} \sec ^{2}{\left (e + f x \right )}\, dx + \int c^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int d^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int 2 d^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int d^{2} \sec ^{5}{\left (e + f x \right )}\, dx + \int 2 c d \sec ^{2}{\left (e + f x \right )}\, dx + \int 4 c d \sec ^{3}{\left (e + f x \right )}\, dx + \int 2 c d \sec ^{4}{\left (e + f x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))**2*(c+d*sec(f*x+e))**2,x)

[Out]

a**2*(Integral(c**2*sec(e + f*x), x) + Integral(2*c**2*sec(e + f*x)**2, x) + Integral(c**2*sec(e + f*x)**3, x)
 + Integral(d**2*sec(e + f*x)**3, x) + Integral(2*d**2*sec(e + f*x)**4, x) + Integral(d**2*sec(e + f*x)**5, x)
 + Integral(2*c*d*sec(e + f*x)**2, x) + Integral(4*c*d*sec(e + f*x)**3, x) + Integral(2*c*d*sec(e + f*x)**4, x
))

________________________________________________________________________________________